import request from '@/utils/request'

const api_name = `person`

export default {
    listPage(current,limit,searchObj){
        return request({
            url: `${api_name}/list/${current}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    savePerson(person){
        return request({
            url: `${api_name}/add`,
            method: 'post',
            params: person
        })
    },
    editPerson(person){
        return request({
            url: `${api_name}/update`,
            method: 'put',
            params: person
        })
    },
    delById(id){
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete',
        })
    },
    batchDelById(ids){
        return request({
            url: `${api_name}/batchDelById`,
            method: 'delete',
            data: ids
        })
    },
    batchUpdateById(status,ids){
        return request({
            url: `${api_name}/batchUpdateById/${status}`,
            method: 'put',
            data: ids
        })
    },
    checkPersonByName(name){
        return request({
            url: `${api_name}/checkPersonByName/${name}`,
            method: 'get',
        })
    }
}